import request from "@/request/request";
import qs from "qs";
//精品推荐数据接口
export const JingpinAPI = () => request.get("/products/recommend");
//热门兑换接口

export const ReMenAPI = () => request.get("/products/hot");
// 发送短信验证码请求
export const SendSMSAPI = (params) =>
  request.post("/sendSMS", qs.stringify(params));
//手机验证码登录请求接口
export const PhoneLoginAPI = (params) =>
  request.post("/phoneRegin", qs.stringify(params));
// 微信登录（这个接口必须用qs对数据进行格式化）
export const WeixinLoginApi = (params) =>
  request.post(`/wechatUsers/PCLogin`, qs.stringify(params));
//微信绑定手机
export const BindPhoneAPI = (params) =>
  request.post(`/wechatUsers/binding`, qs.stringify(params));
//获取用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles");
//请求详情页接口
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);
//添加到购物车
export const AddToCartAPI = (params) =>
  request.post(`/shop/carts/add`, qs.stringify(params));
//请求全部商品

export const GoodsSearchAPI = (params) => request.get("/products", { params }); // {params：params}
//获取购物车数据
export const CartDataAPI = () => request.get("/shop/carts");
//删除商品
export const DelgoodAPI = (id) =>
  request.delete(`/shop/carts?productIds=${id}`);
